package com.taobao.txc.a.b;

import com.taobao.txc.common.LoggerWrap;
import com.taobao.txc.common.c.D;
import com.taobao.txc.common.c.F;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.ConcurrentHashMap;

class l
  implements Runnable
{
  l(g paramg) {}
  
  public void run()
  {
    for (;;)
    {
      synchronized (this.a.q)
      {
        try
        {
          this.a.q.wait(1L);
        }
        catch (InterruptedException localInterruptedException) {}
      }
      this.a.l = true;
      ??? = this.a.o.keySet().iterator();
      while (((Iterator)???).hasNext())
      {
        String str = (String)((Iterator)???).next();
        BlockingQueue localBlockingQueue = (BlockingQueue)this.a.o.get(str);
        if (!localBlockingQueue.isEmpty())
        {
          D localD = new D();
          Object localObject2;
          for (int i = 0; !localBlockingQueue.isEmpty(); i++)
          {
            localObject2 = (u)localBlockingQueue.poll();
            localD.a.add((F)((u)localObject2).f());
            localD.b.add(Long.valueOf(((u)localObject2).e()));
          }
          if ((i > 1) && (g.i().c()))
          {
            g.i().debug("msgs:" + i);
            localObject2 = localD.a.iterator();
            while (((Iterator)localObject2).hasNext())
            {
              localObject3 = (F)((Iterator)localObject2).next();
              g.i().debug(localObject3.toString());
            }
            localObject2 = new StringBuffer();
            Object localObject3 = localD.b.iterator();
            long l;
            while (((Iterator)localObject3).hasNext())
            {
              l = ((Long)((Iterator)localObject3).next()).longValue();
              ((StringBuffer)localObject2).append("msgid:").append(l).append(";");
            }
            ((StringBuffer)localObject2).append("\n");
            localObject3 = this.a.n.keySet().iterator();
            while (((Iterator)localObject3).hasNext())
            {
              l = ((Long)((Iterator)localObject3).next()).longValue();
              ((StringBuffer)localObject2).append("futures:").append(l).append(";");
            }
            g.i().debug(((StringBuffer)localObject2).toString());
          }
          try
          {
            this.a.a(this.a.c(str), localD);
          }
          catch (Exception localException)
          {
            if ((localException.getMessage() != null) && (localException.getMessage().contains("channel is not writable")) && (str != null)) {
              this.a.b.remove(str);
            }
            g.i().a("", "client merge call failed", localException);
          }
        }
      }
      this.a.l = false;
    }
  }
}


/* Location:           C:\Users\ibm\Downloads\txc-yun-sample (1)\txc-yun-sample\lib\txc-client-2.0.72.jar
 * Qualified Name:     com.taobao.txc.a.b.l
 * JD-Core Version:    0.7.0.1
 */